package BasicGrammar.Basic;

public class day_0919 {
    static int count = 0;
    public static void main(String[] args) {

        hannio(14, 'A', 'B', 'C');

        System.out.println((count));
    }
    

    
    public static void hannio(int n,char a,char b,char c){
        count += 1;

        if (n == 1){
            move(a,b);
            return;
        }
        hannio(n-1,a,c,b);

        move(a,c);

        hannio(n-1,b,a,c);
        

    }

    public static void move(char p1,char p2) {
        System.out.println((p1 + "->" + p2 + " "));
    }
}
